package edu.grupo4.applaboratorio;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class Laboratorio_Activity extends Activity {
	private String[] unidades = { "CIB", "FIEC", "FICT", "FIMCP","ICM", "EDCOM" };
	private ListView lv1;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.laboratorio_xml);

        lv1 =(ListView)findViewById(R.id.listViewUnidades);     
        ArrayAdapter <String> adapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, unidades);
        lv1.setAdapter(adapter);
        lv1.setOnItemClickListener(new OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View v, int posicion, long id) {
            	lanzarItemLab(v);
            }
        }); 
	
}
	public void lanzarItemLab(View view) {
        Intent i = new Intent(this, ItemLaboratorio_Activity.class );
        startActivity(i);
  } 
	public void lanzarInicio(View view) {
        Intent i = new Intent(this, MainActivity.class );
        startActivity(i);
  }
	    
}
